For making this dialog disappear, the Qt code should check whether that .txt file contains the string "OK" in the first line
You can use QFileSystemWatcher for that (fileChanged(QString) signal).
The dialog should disappear only when this "OK" is found, until then it should continue to display "generating image..."
I'd use some kind of timeout too, especially if this "OK" is written by some other process. Btw. check if there is no "OK" already before displaying the dialog 
Also, I don't really understand this line:
void MyTask::perform()
{
disconnect(pd, SIGNAL(canceled()), this, SLOT(cancel()));
...
}
void MyTask::perform()
{
disconnect(pd, SIGNAL(canceled()), this, SLOT(cancel()));
...
}
To copy to clipboard, switch view to plain text mode
Why do you keep disconnecting the signal over and over on each timer tick ?
Bookmarks